home *** CD-ROM | disk | FTP | other *** search
- Path: maroon.tc.umn.edu!haizh001
- From: haizh001@maroon.tc.umn.edu (Haizhou Chen)
- Newsgroups: comp.lang.c++
- Subject: Help: Borland C++ 4.52 Link Problem
- Date: 21 Jan 1996 22:31:06 -0600
- Organization: University of Minnesota
- Message-ID: <haizh001.822284224@maroon.tc.umn.edu>
- NNTP-Posting-Host: maroon.tc.umn.edu
-
- Hi, I am having problem linking my C++ code with library or object file.
- Here is an example:
-
- ---------------mytest.cpp---------------------
- #include <iostream.h>
-
- void mytest( int i)
- { int j;
- cout << "Please enter an integer:"
- cin >> j:
- cout << i*j << endl;
- }
-
- ------------------end of mytest.cpp--------------
-
- I created a library mytest.lib with this file.
-
- Then in the main file:
-
- ----------- proj0001.cpp--------------------
- extern void mytest(int);
-
- main()
- { mytest(2);
- return 0;
- }
-
- ---------------- end of proj0001.cpp ------------------
-
- I created a project of EasyWin with two nodes: proj0001.cpp and mytest.lib
- Then I tried to build the project. There wasn't any compilation error. But
- the linker complains:
-
- Compiling PROJ0001.CPP:
- Linking target.exe:
- Linker Warning: No module definition file specified: using defaults
- Linker Error: Undefined symbol ostream::outstr(const char near*,const char near*) in module mytest.cpp
- Linker Error: Undefined symbol endl(ostream near&) in module mytest.cpp
- Linker Error: Undefined symbol istream::operator >>(int near&) in module mytest.cpp
-
-
- I guess I didn't link the project with I/O library. But I don't know how to
- do that. Can anybody give me a pointer?
-
- Any help is greatly appreciated.
-
- Haizhou Chen.
-
- hachen@cs.umn.edu
-